package cn.itcast.asdasd;

import java.util.Arrays;

public class ArraysTest {
    public static void F(int...m){
        for(int i:m){
            System.out.printf("%d ",i);
        }
        System.out.println();
        for(int i=1;i<=5;++i){
            System.out.printf("%d ",m[i]);
        }
        System.out.println();
    }
    public static void main(String[] args) {
        int array[]={1,4,2,5,6,7};
        int array2[]=new int[10];
//binarySearch
        System.out.println(Arrays.binarySearch(array,5));
        System.out.println(Arrays.binarySearch(array,0));
//equals
        System.out.println(Arrays.equals(array,array));
//arraycopy
        System.arraycopy(array,1,array2,0,array.length-3);
        System.out.println(Arrays.toString(array2));
//fill
        Arrays.fill(array2,100);
        System.out.println(Arrays.toString(array2));
        System.out.println("------------------------");

        int a[]={1,2,3,4,6,2,3};
        F(1,2,3,6,5,4,7);
        System.out.println(a);
        for(int i:a){
            System.out.printf("%d ",i);
        }
    }
}
